Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executer: add Cop_time in slow log (#16873) #16904

Merged
merged 5 commits into from
Apr 30, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 28, 2020

cherry-pick #16873 to release-4.0


What problem does this PR solve?

Before this PR, TiDB Slow log only record Process_time, but it is the total process time of cop task spend on TiKV, we still don't know the related Cop_time spend in tidb, as below:

image

What is changed and how it works?

Add Cop_time in slow_query and slow log. The Cop_time contain the time duration as below:

  • Send Cop request.
  • Send request to TiKV network latency duration.
  • TiKV handle cop request duration.
  • Send result to TiDB network latency.
  • Recieve result latency.
  • If meet error, maybe retry upper steps.
mysql>select query_time,cop_time,query from `CLUSTER_SLOW_QUERY` where cop_time>0 limit 3;
+-------------+-------------+---------------------------------------------------------------------------------------------------+
| query_time  | cop_time    | query                                                                                             |
+-------------+-------------+---------------------------------------------------------------------------------------------------+
| 0.382663125 | 0.382427668 | select count(*) from t2;                                                                          |
| 0.329472658 | 0.329190264 | select count(*) from t2;                                                                          |
| 0.929105778 | 0.400684833 | select count(*) from t2 where c2 >=0 and c1 in (select c1 from t2 where c7!=now()) and c8!=now(); |
+-------------+-------------+---------------------------------------------------------------------------------------------------+

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

@sre-bot sre-bot requested a review from a team as a code owner April 28, 2020 07:09
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 28, 2020

/run-all-tests

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crazycs520 crazycs520 removed this from the v4.0.0-rc.1 milestone Apr 28, 2020
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bb7133
Copy link
Member

bb7133 commented Apr 28, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 28, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 28, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 28, 2020

@sre-bot merge failed.

@crazycs520
Copy link
Contributor

/run-integration-copr-test

@zz-jason
Copy link
Member

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 30, 2020

Your auto merge job has been accepted, waiting for:

  • 16907

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 30, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 30, 2020

@sre-bot merge failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/infoschema sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants